<template>
	<view class="main-content">
		<scroll-view scroll-y class="main-box">
			<view class="main-item">
				<text class="title">我的维保公司</text>
				<view class="company-list">
					<text class="company-title">{{companyInfo.companyName}}</text>
					<text class="company-profile">{{companyInfo.contact}} {{companyInfo.phoneNumber}}</text>
				</view>
			</view>
			<view class="main-item">
				<text class="title">公司资料</text>
				<view class="info">
					<text class="subhead">简介</text>
					<text class="info-content">{{companyInfo.intro || ''}}</text>
				</view>
				<view class="info">
					<text class="subhead">地址</text>
					<text
						class="info-content">{{companyInfo.address}}</text>
				</view>
				<!-- <view class="info">
					<text class="subhead">其他相关信息</text>
					<view class="info-item" v-for="t in 2" :key="t">
						<text class="info-name">信息项</text>
						<text class="info-data">信息内容</text>
					</view>
				</view> -->
			</view>
		</scroll-view>
	</view>
</template>

<script>
	import Home from '@/api/home.js'
	export default {
		data() {
			return {
				companyInfo: {},
				companyId: ""
			}
		},
		onLoad(e) {
			console.log(e);
			this.companyId = e.companyId;
			this.getCompanyInfo();
		},
		methods: {
			async getCompanyInfo() {
				let res = await Home.getMaintainCompanyInfo(this.companyId);
				this.companyInfo = res.data;
			}
		}
	}
</script>

<style scoped lang="less">
	.main-content {
		width: 100%;
		height: 100%;
		.main-box {
			padding: 20rpx 30rpx;
			background: #ffffff;
			height: 100vh;
			box-sizing: border-box;
			box-sizing: border-box;
			padding-bottom: calc(env(safe-area-inset-bottom));
			.main-item {
				.title {
					display: block;
					font-family: "PingFang SC";
					font-size: 28rpx;
					font-style: normal;
					font-weight: 550;
					line-height: 40rpx;
					padding: 20rpx 0;
				}

				.company-list {
					padding: 35rpx 30rpx;
					border-radius: 30rpx;
					background: #dbefff;
					margin-bottom: 20rpx;

					.company-title {
						display: block;
						font-family: "PingFang SC";
						font-size: 28rpx;
						font-style: normal;
						font-weight: 500;
						line-height: 40rpx;
						margin-bottom: 20rpx;
					}

					.company-profile {
						font-family: "PingFang SC";
						font-size: 24rpx;
						font-style: normal;
						font-weight: 400;
						line-height: normal;
						opacity: 0.6;
					}
				}

				.info {
					.subhead {
						display: block;
						padding: 10rpx 0 20rpx;
						font-family: "PingFang SC";
						font-size: 28rpx;
						font-style: normal;
						font-weight: 400;
						line-height: 40rpx;
					}

					.info-content {
						display: block;
						font-family: "PingFang SC";
						font-size: 24rpx;
						font-style: normal;
						font-weight: 400;
						line-height: 40rpx;
						opacity: 0.6;
						margin-bottom: 30rpx;
					}

					.info-item {
						display: flex;
						justify-content: space-between;
						margin-bottom: 40rpx;

						.info-name {
							font-size: 28rpx;
							font-style: normal;
							font-weight: 400;
							line-height: 40rpx;
							opacity: 0.6;
						}

						.info-data {
							font-family: "PingFang SC";
							font-size: 28rpx;
							font-style: normal;
							font-weight: 400;
							line-height: 40rpx;
						}
					}
				}
			}
		}
	}
</style>